﻿using LdtJudge.DataEngine.CallInterface;
using LdtJudge.DataEngine.CallInterface.ConfiCenter;
using LdtJudge.DataEngine.CallInterface.ConfigManager;
using LdtJudge.DataEngine.Common.CommonWordHandle;
using LdtJudge.DataEngine.DataBaseStores;
using LdtJudge.DataEngine.Model.CommModel;
using Microsoft.Extensions.Configuration;
using System;

namespace Ldt.TestMain
{
    public class Program
    {

        static void Main(string[] args)
        {

            IConfiguration _configuration = new ConfigurationBuilder().SetBasePath(System.AppContext.BaseDirectory).AddJsonFile("appsettings.json", true, true).Build();
           
            ConfigManagerHandle  configManagerHandle = new ConfigManagerHandle(_configuration);
            IConfigRetrieval configRetrieval = new ConfigRetrieval(_configuration, configManagerHandle);

            WordHandle wordHandle = new WordHandle();
            string content = wordHandle.GetWordContent(@"D:\wd\争议焦点333\（2018）冀民初852号（庭审笔录）.docx");
            MainInputParameterModel inputParameter = new MainInputParameterModel()
            {
                CaseType = "b1",
                DocID = "MSCourtRecord",
                SourceContent = content,
                SD_CaseOnlyID = "gggg33333",
                FilePath = "",
                CaseCause = "",
                CourtId = "",
                AppId = "",
                CaseID = "",
                FL_ID = "",
                SF_ID = "",
                IsSave = true
            };
            Ldt.DataEngin.Assemble.Main main = new DataEngin.Assemble.Main(inputParameter,configRetrieval);
            main.LogShow = LogShow;
            main.ProcessShow = SetProcess;
            main.ModuleProcessShow = SetModuleProcess;
            main.ModularModel = ModularModelSet;
            main.configRetrieval = configRetrieval;
            main.Extract();
        }

        /// <summary>
        /// 日志显示有字体样式
        /// </summary>
        /// <param name="logInfo">日志</param>
        /// <param name="fontStyles">日志样式</param>
        /// <param name="logType">日志类型</param>
        public static void LogShowFontStyle(string logInfo, FontStyles fontStyles, LogMessageType logType)
        {
            Console.WriteLine(logInfo);
        }

        /// <summary>
        /// 日志显示
        /// </summary>
        /// <param name="logType">日志类型</param>
        /// <param name="logInfo">日志</param>
        public static void LogShow(string logInfo,LogMessageType logType)
        {
            LogShowFontStyle(logInfo, FontStyles.defult, logType);
        }

        /// <summary>
        /// 设置进度条
        /// </summary>
        /// <param name="fileId"></param>
        /// <param name="nValue"></param>
        public static void SetProcess(string fileId, int nValue)
        {
            
        }

        /// <summary>
        /// 设置模块执行的进度
        /// </summary>
        /// <param name="moduleName">模块名称</param>
        /// <param name="processValue">执行进度</param>
        public static void SetModuleProcess(string moduleName, int processValue)
        {
            
        }

        public static void ModularModelSet(string mdoelstring, string type)
        { 
        
        }
    }
}
